unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ScktComp, StdCtrls, RzEdit, ExtCtrls, RzPanel;

type
  TForm1 = class(TForm)
    ClientSocket1: TClientSocket;
    RzGroupBox1: TRzGroupBox;
    RzMemo1: TRzMemo;
    Button1: TButton;
    Button2: TButton;
    procedure ClientSocket1Connect(Sender: TObject;
      Socket: TCustomWinSocket);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket);
    procedure ClientSocket1Disconnect(Sender: TObject;
      Socket: TCustomWinSocket);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ClientSocket1Connect(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  RzMemo1.Lines.Add('is connected.');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ClientSocket1.Host:='10.10.11.56';
  ClientSocket1.Port:=17763;

  ClientSocket1.Active:=True;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ClientSocket1.Socket.SendText('00005201.00330212   3940201002201208244033610000673391                     2167.44');
end;

procedure TForm1.ClientSocket1Read(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  RzMemo1.Lines.Add(Socket.ReceiveText);
end;

procedure TForm1.ClientSocket1Disconnect(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  RzMemo1.Lines.Add('disconnected.');
end;

end.
